package com.wlt.controller;

import com.wlt.pojo.Category;
import com.wlt.result.BaseResult;
import com.wlt.service.CategoryService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 广告相关的控制器
 */
@RestController
@RequestMapping("/user/category")
public class CategoryController
{
    @DubboReference
    private CategoryService categoryService;
    
    @GetMapping ("/all")
    public BaseResult<List<Category>> findAll ()
    {
        List<Category> lists = categoryService.findAll();
        
        return BaseResult.success(lists);
    }
}
